package cn.raven.controller;

import cn.raven.entity.User;
import cn.raven.feign.UserFeignClient;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor  //可以不用@Autowired注入了
public class OrderController {
    private UserFeignClient userFeignClient;

    @GetMapping("/getUser/{id}")
    public User getUser(@PathVariable Long id){
        return userFeignClient.getUser(id);
    }
}
